{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">
                        <div class="form-group">
    <label for="order_sn" class="col-sm-2 control-label">订单编号</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_sn" name="order_sn" value="{$data.order_sn|default=''}" placeholder="请输入订单编号" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="user_id" class="col-sm-2 control-label">用户id</label>
    <div class="col-sm-10 col-md-4">
        <select name="user_id" id="user_id" class="form-control field-select" data-placeholder="请选择用户id">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#user_id').select2();
</script>
<div class="form-group">
    <label for="order_type" class="col-sm-2 control-label">订单类型;0-普通订单;1-秒杀订单;2-拼团订单;3-砍价订单</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_type" name="order_type" value="{$data.order_type|default='0'}" placeholder="请输入订单类型;0-普通订单;1-秒杀订单;2-拼团订单;3-砍价订单" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="order_source" class="col-sm-2 control-label">订单来源;1-小程序;2-h5;3-ios;4-安卓</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_source" name="order_source" value="{$data.order_source|default='1'}" placeholder="请输入订单来源;1-小程序;2-h5;3-ios;4-安卓" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="order_status" class="col-sm-2 control-label">订单状态;0-待付款;1-待发货;2-待收货;3-已完成;4-已关闭</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_status" name="order_status" value="{$data.order_status|default='0'}" placeholder="请输入订单状态;0-待付款;1-待发货;2-待收货;3-已完成;4-已关闭" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="pay_status" class="col-sm-2 control-label">支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款</label>
    <div class="col-sm-10 col-md-4">
        <input id="pay_status" name="pay_status" value="{$data.pay_status|default='0'}" placeholder="请输入支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="pay_way" class="col-sm-2 control-label">1-微信支付  2-支付宝支付 3-余额支付</label>
    <div class="col-sm-10 col-md-4">
        <input id="pay_way" name="pay_way" value="{$data.pay_way|default='1'}" placeholder="请输入1-微信支付  2-支付宝支付 3-余额支付" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="pay_time" class="col-sm-2 control-label">支付时间</label>
    <div class="col-sm-10 col-md-4">
        <input id="pay_time" name="pay_time" value="{$data.pay_time|default='0'}" placeholder="请选择支付时间" type="text" class="form-control filed-datetime">
    </div>
</div>
<script>
    laydate.render({
        elem: '#pay_time',
        type: 'datetime',
    });
</script>
<div class="form-group">
    <label for="consignee" class="col-sm-2 control-label">收货人</label>
    <div class="col-sm-10 col-md-4">
        <input id="consignee" name="consignee" value="{$data.consignee|default=''}" placeholder="请输入收货人" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="province" class="col-sm-2 control-label">省份</label>
    <div class="col-sm-10 col-md-4">
        <input id="province" name="province" value="{$data.province|default='0'}" placeholder="请输入省份" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="city" class="col-sm-2 control-label">城市</label>
    <div class="col-sm-10 col-md-4">
        <input id="city" name="city" value="{$data.city|default='0'}" placeholder="请输入城市" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="district" class="col-sm-2 control-label">县区</label>
    <div class="col-sm-10 col-md-4">
        <input id="district" name="district" value="{$data.district|default='0'}" placeholder="请输入县区" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="address" class="col-sm-2 control-label">地址</label>
    <div class="col-sm-10 col-md-4">
        <input id="address" name="address" value="{$data.address|default=''}" placeholder="请输入地址" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="mobile" class="col-sm-2 control-label">手机</label>
    <div class="col-sm-10 col-md-4">
        <input id="mobile" name="mobile" value="{$data.mobile|default=''}" placeholder="请输入手机" type="tel" maxlength="11" class="form-control field-mobile">
    </div>
</div>
<div class="form-group">
    <label for="delivery_type" class="col-sm-2 control-label">配送方式;1-快递发货;2-上门自提;</label>
    <div class="col-sm-10 col-md-4">
        <input id="delivery_type" name="delivery_type" value="{$data.delivery_type|default='1'}" placeholder="请输入配送方式;1-快递发货;2-上门自提;" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="goods_price" class="col-sm-2 control-label">订单商品总价</label>
    <div class="col-sm-10 col-md-4">
         <div class="input-group">
            <input id="goods_price" name="goods_price" value="{$data.goods_price|default='0.00'}" placeholder="请输入订单商品总价" type="number" class="form-control field-number">
        </div>
    </div>
</div>
<script>
    $('#goods_price')
        .bootstrapNumber({
            upClass: 'success',
            downClass: 'primary',
            center: true
        });
</script>
<div class="form-group">
    <label for="order_amount" class="col-sm-2 control-label">应付款金额</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_amount" name="order_amount" value="{$data.order_amount|default='0.00'}" placeholder="请输入应付款金额" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="discount_amount" class="col-sm-2 control-label">优惠金额</label>
    <div class="col-sm-10 col-md-4">
        <input id="discount_amount" name="discount_amount" value="{$data.discount_amount|default='0.00'}" placeholder="请输入优惠金额" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="integral_amount" class="col-sm-2 control-label">积分抵扣金额</label>
    <div class="col-sm-10 col-md-4">
        <input id="integral_amount" name="integral_amount" value="{$data.integral_amount|default='0.00'}" placeholder="请输入积分抵扣金额" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="total_amount" class="col-sm-2 control-label">订单总价</label>
    <div class="col-sm-10 col-md-4">
        <input id="total_amount" name="total_amount" value="{$data.total_amount|default='0.00'}" placeholder="请输入订单总价" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="total_num" class="col-sm-2 control-label">订单商品数量</label>
    <div class="col-sm-10 col-md-4">
        <input id="total_num" name="total_num" value="{$data.total_num|default='0'}" placeholder="请输入订单商品数量" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="shipping_status" class="col-sm-2 control-label">发货状态</label>
    <div class="col-sm-10 col-md-4">
        <input id="shipping_status" name="shipping_status" value="{$data.shipping_status|default='0'}" placeholder="请输入发货状态" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="shipping_price" class="col-sm-2 control-label">运费</label>
    <div class="col-sm-10 col-md-4">
         <div class="input-group">
            <input id="shipping_price" name="shipping_price" value="{$data.shipping_price|default='0.00'}" placeholder="请输入运费" type="number" class="form-control field-number">
        </div>
    </div>
</div>
<script>
    $('#shipping_price')
        .bootstrapNumber({
            upClass: 'success',
            downClass: 'primary',
            center: true
        });
</script>
<div class="form-group">
    <label for="shipping_time" class="col-sm-2 control-label">最后新发货时间</label>
    <div class="col-sm-10 col-md-4">
        <input id="shipping_time" name="shipping_time" value="{$data.shipping_time|default='0'}" placeholder="请选择最后新发货时间" type="text" class="form-control filed-datetime">
    </div>
</div>
<script>
    laydate.render({
        elem: '#shipping_time',
        type: 'datetime',
    });
</script>
<div class="form-group">
    <label for="wechat_mini_express_sync" class="col-sm-2 control-label">微信小程序发货信息录入</label>
    <div class="col-sm-10 col-md-4">
        <input id="wechat_mini_express_sync" name="wechat_mini_express_sync" value="{$data.wechat_mini_express_sync|default='0'}" placeholder="请输入微信小程序发货信息录入" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="wechat_mini_express_sync_time" class="col-sm-2 control-label">录入时间</label>
    <div class="col-sm-10 col-md-4">
        <input id="wechat_mini_express_sync_time" name="wechat_mini_express_sync_time" value="{$data.wechat_mini_express_sync_time|default='0'}" placeholder="请选择录入时间" type="text" class="form-control filed-datetime">
    </div>
</div>
<script>
    laydate.render({
        elem: '#wechat_mini_express_sync_time',
        type: 'datetime',
    });
</script>
<div class="form-group">
    <label for="transaction_id" class="col-sm-2 control-label">第三方平台交易流水号</label>
    <div class="col-sm-10 col-md-4">
        <select name="transaction_id" id="transaction_id" class="form-control field-select" data-placeholder="请选择第三方平台交易流水号">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#transaction_id').select2();
</script>
<div class="form-group">
    <label for="user_remark" class="col-sm-2 control-label">用户备注</label>
    <div class="col-sm-10 col-md-4">
        <input id="user_remark" name="user_remark" value="{$data.user_remark|default=''}" placeholder="请输入用户备注" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="confirm_take_time" class="col-sm-2 control-label">确认收货时间</label>
    <div class="col-sm-10 col-md-4">
        <input id="confirm_take_time" name="confirm_take_time" value="{$data.confirm_take_time|default=''}" placeholder="请选择确认收货时间" type="text" class="form-control filed-datetime">
    </div>
</div>
<script>
    laydate.render({
        elem: '#confirm_take_time',
        type: 'datetime',
    });
</script>
<div class="form-group">
    <label for="cancel_time" class="col-sm-2 control-label">订单取消时间</label>
    <div class="col-sm-10 col-md-4">
        <input id="cancel_time" name="cancel_time" value="{$data.cancel_time|default=''}" placeholder="请选择订单取消时间" type="text" class="form-control filed-datetime">
    </div>
</div>
<script>
    laydate.render({
        elem: '#cancel_time',
        type: 'datetime',
    });
</script>
<div class="form-group">
    <label for="refund_status" class="col-sm-2 control-label">退款状态：0-未退款；1-部分退款；2-全部退款</label>
    <div class="col-sm-10 col-md-4">
        <input id="refund_status" name="refund_status" value="{$data.refund_status|default='0'}" placeholder="请输入退款状态：0-未退款；1-部分退款；2-全部退款" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="settle_id" class="col-sm-2 control-label">结算id；0-未结算</label>
    <div class="col-sm-10 col-md-4">
        <select name="settle_id" id="settle_id" class="form-control field-select" data-placeholder="请选择结算id；0-未结算">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#settle_id').select2();
</script>
<div class="form-group">
    <label for="settle_amount" class="col-sm-2 control-label">结算金额</label>
    <div class="col-sm-10 col-md-4">
        <input id="settle_amount" name="settle_amount" value="{$data.settle_amount|default=''}" placeholder="请输入结算金额" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="use_integral" class="col-sm-2 control-label">使用的积分</label>
    <div class="col-sm-10 col-md-4">
        <input id="use_integral" name="use_integral" value="{$data.use_integral|default='0'}" placeholder="请输入使用的积分" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="refund_amount" class="col-sm-2 control-label">退款金额</label>
    <div class="col-sm-10 col-md-4">
        <input id="refund_amount" name="refund_amount" value="{$data.refund_amount|default=''}" placeholder="请输入退款金额" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="order_remarks" class="col-sm-2 control-label">订单备注</label>
    <div class="col-sm-10 col-md-4">
        <input id="order_remarks" name="order_remarks" value="{$data.order_remarks|default=''}" placeholder="请输入订单备注" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="coupon_list_id" class="col-sm-2 control-label">用户优惠券id</label>
    <div class="col-sm-10 col-md-4">
        <select name="coupon_list_id" id="coupon_list_id" class="form-control field-select" data-placeholder="请选择用户优惠券id">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#coupon_list_id').select2();
</script>
<div class="form-group">
    <label for="team_found_id" class="col-sm-2 control-label">拼团id</label>
    <div class="col-sm-10 col-md-4">
        <select name="team_found_id" id="team_found_id" class="form-control field-select" data-placeholder="请选择拼团id">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#team_found_id').select2();
</script>
<div class="form-group">
    <label for="team_id" class="col-sm-2 control-label">拼团活动id</label>
    <div class="col-sm-10 col-md-4">
        <select name="team_id" id="team_id" class="form-control field-select" data-placeholder="请选择拼团活动id">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#team_id').select2();
</script>
<div class="form-group">
    <label for="delivery_id" class="col-sm-2 control-label">发货单ID</label>
    <div class="col-sm-10 col-md-4">
        <select name="delivery_id" id="delivery_id" class="form-control field-select" data-placeholder="请选择发货单ID">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#delivery_id').select2();
</script>
<div class="form-group">
    <label for="attach_values" class="col-sm-2 control-label">附带的值(赠送时机，赠送积分成长值什么的)Json格式</label>
        <div class="col-sm-10">
            <script id="attach_values" name="attach_values" type="text/plain">{$data.attach_values|raw|default=''}</script>
        </div>
    </div>
<script>
    UE.delEditor('attach_values');
    var UE_attach_values = UE.getEditor('attach_values',{
        serverUrl :UEServer
    });
</script>
<div class="form-group">
    <label for="pickup_code" class="col-sm-2 control-label">提货码</label>
    <div class="col-sm-10 col-md-4">
        <input id="pickup_code" name="pickup_code" value="{$data.pickup_code|default=''}" placeholder="请输入提货码" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="verification_status" class="col-sm-2 control-label">核销状态:0-待核销;1-已核销;</label>
    <div class="col-sm-10 col-md-4">
        <input id="verification_status" name="verification_status" value="{$data.verification_status|default='0'}" placeholder="请输入核销状态:0-待核销;1-已核销;" type="text" class="form-control field-text">
    </div>
</div>
<div class="form-group">
    <label for="selffetch_shop_id" class="col-sm-2 control-label">自提门店ID</label>
    <div class="col-sm-10 col-md-4">
        <select name="selffetch_shop_id" id="selffetch_shop_id" class="form-control field-select" data-placeholder="请选择自提门店ID">
            <option value=""></option>
            
        </select>
    </div>
</div>
<script>
 $('#selffetch_shop_id').select2();
</script>

                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        {:token()}
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            {if !isset($data)}
                                <div class="btn-group pull-right">
                                    <label class="createContinue">
                                        <input type="checkbox" value="1" id="_create" name="_create"
                                                                   title="继续添加数据">继续添加</label>
                                </div>
                             {/if}
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="reset" class="btn flat btn-default dataFormReset">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
                'order_sn': {
        required: true,
    },
    'user_id': {
        required: true,
    },
    'order_type': {
        required: true,
    },
    'order_source': {
        required: true,
    },
    'order_status': {
        required: true,
    },
    'pay_status': {
        required: true,
    },
    'pay_way': {
        required: true,
    },
    'pay_time': {
        required: true,
    },
    'consignee': {
        required: true,
    },
    'province': {
        required: true,
    },
    'city': {
        required: true,
    },
    'district': {
        required: true,
    },
    'address': {
        required: true,
    },
    'mobile': {
        required: true,
    },
    'delivery_type': {
        required: true,
    },
    'goods_price': {
        required: true,
    },
    'order_amount': {
        required: true,
    },
    'discount_amount': {
        required: true,
    },
    'integral_amount': {
        required: true,
    },
    'total_amount': {
        required: true,
    },
    'total_num': {
        required: true,
    },
    'shipping_status': {
        required: true,
    },
    'shipping_price': {
        required: true,
    },
    'shipping_time': {
        required: true,
    },
    'wechat_mini_express_sync': {
        required: true,
    },
    'wechat_mini_express_sync_time': {
        required: true,
    },
    'transaction_id': {
        required: true,
    },
    'user_remark': {
        required: true,
    },
    'confirm_take_time': {
        required: true,
    },
    'cancel_time': {
        required: true,
    },
    'refund_status': {
        required: true,
    },
    'settle_id': {
        required: true,
    },
    'settle_amount': {
        required: true,
    },
    'use_integral': {
        required: true,
    },
    'refund_amount': {
        required: true,
    },
    'order_remarks': {
        required: true,
    },
    'coupon_list_id': {
        required: true,
    },
    'team_found_id': {
        required: true,
    },
    'team_id': {
        required: true,
    },
    'delivery_id': {
        required: true,
    },
    'attach_values': {
        required: true,
    },
    'pickup_code': {
        required: true,
    },
    'verification_status': {
        required: true,
    },
    'selffetch_shop_id': {
        required: true,
    },

        },
        messages: {
                'order_sn': {
        required: "订单编号不能为空",
    },
    'user_id': {
        required: "用户id不能为空",
    },
    'order_type': {
        required: "订单类型;0-普通订单;1-秒杀订单;2-拼团订单;3-砍价订单不能为空",
    },
    'order_source': {
        required: "订单来源;1-小程序;2-h5;3-ios;4-安卓不能为空",
    },
    'order_status': {
        required: "订单状态;0-待付款;1-待发货;2-待收货;3-已完成;4-已关闭不能为空",
    },
    'pay_status': {
        required: "支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款不能为空",
    },
    'pay_way': {
        required: "1-微信支付  2-支付宝支付 3-余额支付不能为空",
    },
    'pay_time': {
        required: "支付时间不能为空",
    },
    'consignee': {
        required: "收货人不能为空",
    },
    'province': {
        required: "省份不能为空",
    },
    'city': {
        required: "城市不能为空",
    },
    'district': {
        required: "县区不能为空",
    },
    'address': {
        required: "地址不能为空",
    },
    'mobile': {
        required: "手机不能为空",
    },
    'delivery_type': {
        required: "配送方式;1-快递发货;2-上门自提;不能为空",
    },
    'goods_price': {
        required: "订单商品总价不能为空",
    },
    'order_amount': {
        required: "应付款金额不能为空",
    },
    'discount_amount': {
        required: "优惠金额不能为空",
    },
    'integral_amount': {
        required: "积分抵扣金额不能为空",
    },
    'total_amount': {
        required: "订单总价不能为空",
    },
    'total_num': {
        required: "订单商品数量不能为空",
    },
    'shipping_status': {
        required: "发货状态不能为空",
    },
    'shipping_price': {
        required: "运费不能为空",
    },
    'shipping_time': {
        required: "最后新发货时间不能为空",
    },
    'wechat_mini_express_sync': {
        required: "微信小程序发货信息录入不能为空",
    },
    'wechat_mini_express_sync_time': {
        required: "录入时间不能为空",
    },
    'transaction_id': {
        required: "第三方平台交易流水号不能为空",
    },
    'user_remark': {
        required: "用户备注不能为空",
    },
    'confirm_take_time': {
        required: "确认收货时间不能为空",
    },
    'cancel_time': {
        required: "订单取消时间不能为空",
    },
    'refund_status': {
        required: "退款状态：0-未退款；1-部分退款；2-全部退款不能为空",
    },
    'settle_id': {
        required: "结算id；0-未结算不能为空",
    },
    'settle_amount': {
        required: "结算金额不能为空",
    },
    'use_integral': {
        required: "使用的积分不能为空",
    },
    'refund_amount': {
        required: "退款金额不能为空",
    },
    'order_remarks': {
        required: "订单备注不能为空",
    },
    'coupon_list_id': {
        required: "用户优惠券id不能为空",
    },
    'team_found_id': {
        required: "拼团id不能为空",
    },
    'team_id': {
        required: "拼团活动id不能为空",
    },
    'delivery_id': {
        required: "发货单ID不能为空",
    },
    'attach_values': {
        required: "附带的值(赠送时机，赠送积分成长值什么的)Json格式不能为空",
    },
    'pickup_code': {
        required: "提货码不能为空",
    },
    'verification_status': {
        required: "核销状态:0-待核销;1-已核销;不能为空",
    },
    'selffetch_shop_id': {
        required: "自提门店ID不能为空",
    },

        }
    });
</script>
{/block}